<?php
    include('js/funcion.inc');
    conecta();
    
    $sql = "SELECT *FROM categorias";
    $resultado = mysql_db_query("grupopl1_plasma", $sql);
    
    $head = "<table class='tabla cont_quienes' >
            <tr>
                <th>Nombre</th>
                <th>Nombre abreviado</th>
                <th>Opciones</th>
                
            </tr>";
    
    $bodyTable = "";
    $cont = 1;
     while ($row = mysql_fetch_array($resultado)){
         if($cont%2==0) $className = "tr_1";
         else $className = "tr_2";
         $bodyTable .= "<tr class='$className'>
                        <td>".$row['nombre_corto']."</td>                   
                        <td>".$row['nombre']."</td>
                        <td><a id='".$row['id']."'>Agregar super categoria</a></td>
                       </tr>
                        ";
         $cont++;
     }
     
     $end = "</table>";
     
     echo $head;
     echo $bodyTable;
     echo $end;
?>
